<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonAllergiesForm.aspx.cs" Inherits="Meditek.UI.PersonAllergiesForm" MasterPageFile="~/MasterPage.Master"%>

<%@ Register Assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    Namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
<br />
  <asp:FormView ID="EditFormView" runat="server" DefaultMode= "Insert" DataSourceID="PersonAllergiesDataSource"
	oniteminserting="EditFormView_ItemInserting"  onitemupdating="EditFormView_ItemUpdating" BackColor="#284775" ForeColor="WhiteSmoke" >
	<EditItemTemplate> 
    <table>

	  <tr>
        <td><asp:Label ID="lblidPersonAllergieDisplay" runat="server" Text="id Person Allergie :" /></td> 
		<td>
		  <asp:TextBox ID="txtidPersonAllergie" runat="server" Text='<%# Bind("idPersonAllergie") %>'
			ReadOnly="true"
			Width = "70px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="idPersonAllergieValidator" runat="server" ControlToValidate="txtidPersonAllergie"
               PropertyName="idPersonAllergie" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblAllergieDisplay"	runat="server"	Text="Name :" /></td>
        <td>
          <asp:DropDownList ID="drlstAllergie" runat="server"	SelectedValue='<%# Bind("Allergie") %>'	Width="100%"
			ondatabinding="drlstAllergie_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="allergieValidator" runat="server" ControlToValidate="drlstAllergie"
             PropertyName="Allergie" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblEndDateDisplay" runat="server" Text="End Date :" /></td> 
		<td>
		  <asp:TextBox ID="txtEndDate" runat="server" Text='<%# Bind("EndDate") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="endDateValidator" runat="server" ControlToValidate="txtEndDate"
               PropertyName="EndDate" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblPersonDisplay"	runat="server"	Text="idPerson :" /></td>
        <td>
          <asp:DropDownList ID="drlstPerson" runat="server"	SelectedValue='<%# Bind("Person") %>'	Width="100%"
			ondatabinding="drlstPerson_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="personValidator" runat="server" ControlToValidate="drlstPerson"
             PropertyName="Person" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblSeverityDisplay"	runat="server"	Text="Name :" /></td>
        <td>
          <asp:DropDownList ID="drlstSeverity" runat="server"	SelectedValue='<%# Bind("Severity") %>'	Width="100%"
			ondatabinding="drlstSeverity_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="severityValidator" runat="server" ControlToValidate="drlstSeverity"
             PropertyName="Severity" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblStartDateDisplay" runat="server" Text="Start Date :" /></td> 
		<td>
		  <asp:TextBox ID="txtStartDate" runat="server" Text='<%# Bind("StartDate") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="startDateValidator" runat="server" ControlToValidate="txtStartDate"
               PropertyName="StartDate" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblStatusDisplay"	runat="server"	Text="Name :" /></td>
        <td>
          <asp:DropDownList ID="drlstStatus" runat="server"	SelectedValue='<%# Bind("Status") %>'	Width="100%"
			ondatabinding="drlstStatus_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="statusValidator" runat="server" ControlToValidate="drlstStatus"
             PropertyName="Status" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblObsDisplay" runat="server" Text="Obsservation :" /></td> 
		<td>
		  <asp:TextBox ID="txtObs" runat="server" Text='<%# Bind("Obs") %>'
			Width = "210px" 
			TextMode="MultiLine"
			Height = "64px" 
			/>
			<br />
            <cc1:PropertyProxyValidator ID="obsValidator" runat="server" ControlToValidate="txtObs"
               PropertyName="Obs" SourceTypeName="Meditek.Entities.PersonAllergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	</table>
	</EditItemTemplate>
	<EmptyDataTemplate>
		<b>PersonAllergies not found..!</b>
	</EmptyDataTemplate>
	<FooterTemplate>
	  <table>
		<tr>
		  <td><asp:Button ID="btnSave" runat="server"   CausesValidation="True"	CommandName="Insert" Text="Save" CssClass="Button" /></td>
 		  <td><asp:Button ID="btnUpdate" runat="server" CausesValidation="True"  CommandName="Update" Text="Save" CssClass="Button" /></td>
		  <td><asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Go To PersonAllergies List" PostBackUrl="PersonAllergiesList.aspx" CssClass="Button" /></td>
        </tr>
	  </table>
	</FooterTemplate>
    </asp:FormView>
	<asp:ObjectDataSource ID="PersonAllergiesDataSource" runat="server" 
         SelectMethod="GetById" TypeName="Meditek.UI.PersonAllergiesReference.PersonAllergiesServiceClient" 
         DataObjectTypeName="Meditek.Entities.PersonAllergies" InsertMethod="Insert"  UpdateMethod="Update"
         oninserted="PersonAllergiesDataSource_CommitChanges" onupdated="PersonAllergiesDataSource_CommitChanges"
         onobjectcreated="PersonAllergiesDataSource_ObjectCreated" >
            <SelectParameters>
                <asp:QueryStringParameter Name="idPersonAllergie" QueryStringField="idPersonAllergie" />
            </SelectParameters>
    </asp:ObjectDataSource>
  </asp:Content>    
